package com.taldh.design.patterns.observer.jdk;

import java.util.Observable;
import java.util.Observer;

/**
 * 观察者唐僧
 * date 2020/5/26
 *
 * @author 袁小黑
 * @version 1.0.0
 **/

class Tangseng implements Observer {


    @Override
    public void update(Observable o, Object arg) {
        switch ((WeatherType) arg) {
            case SUNNY:
                System.out.println("人是人他妈生的，妖是妖他妈生的");
                break;
            case RAINY:
                System.out.println("落雨好收衣服了");
                break;
            case WINDY:
                System.out.println("起风了，要下雨了");
                break;
            case COLD:
                System.out.println("悟空师傅有点冷");
                break;
        }
    }
}
